/*
 * @lc app=leetcode.cn id=461 lang=rust
 *
 * [461] 汉明距离
 */

// @lc code=start
impl Solution {
    pub fn hamming_distance(x: i32, y: i32) -> i32 {
        let mut ret = 0;
        let mut tmp= x ^ y;
        while tmp != 0 {
            if tmp & 0x01 == 0x01{
                ret += 1;
            }
            tmp >>= 1;
        }
        return ret;
    }
}
// @lc code=end

